package com.pz.cloud.framework.business.material.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.pz.cloud.framework.base.model.WorkflowEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
@TableName("material_apply")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="场地物资申请", description="场地物资申请")
public class MaterialApply extends WorkflowEntity {

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty("主键")
    private String id;

//    @Excel(name = "场地物资id", width = 15)
//    @ApiModelProperty("场地物资id")
//    @NotNull
//    private String materialId;

    @Excel(name = "申请人id", width = 15)
    @ApiModelProperty("申请人id")
    private String applierId;

    @Excel(name = "开始使用时间", width = 15)
    @ApiModelProperty("开始使用时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @Excel(name = "结束使用时间", width = 15)
    @ApiModelProperty("结束使用时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date endTime;

//    @Excel(name = "申请数量", width = 15)
//    @ApiModelProperty("申请数量")
//    private Integer count;

    @Excel(name = "申请理由", width = 15)
    @ApiModelProperty("申请理由")
    private String reason;

    @Excel(name = "归还时间", width = 15)
    @ApiModelProperty("归还时间")
    private Date returnTime;

    @ApiModelProperty("姓名")
    @TableField(exist = false)
    private String realname;

    @Excel(name = "场地物资类型", width = 15)
    @ApiModelProperty("场地物资类型")
    @Dict(dicCode = "material_type")
    @TableField(exist = false)
    private String materialType;

    @Excel(name = "场地物资名称", width = 15)
    @ApiModelProperty("场地物资名称")
    @TableField(exist = false)
    private String materialName;

//    @Excel(name = "场地物资编码", width = 15)
//    @ApiModelProperty("场地物资编码")
//    @TableField(exist = false)
//    private String materialCode;

    @ApiModelProperty("布置小时")
    private Integer layoutHour;

    @ApiModelProperty("布置分钟")
    private Integer layoutMinute;

    @ApiModelProperty("管理员到位小时")
    private Integer adminPresentHour;

    @ApiModelProperty("管理员到位分钟")
    private Integer adminPresentMinute;

    @ApiModelProperty(value = "指导老师",required = true)
    private String instructor;

    @ApiModelProperty(value = "指导老师id",required = true)
    private String instructorId;

    @ApiModelProperty(value = "指导老师电话",required = true)
    private String instructorPhone;

    @ApiModelProperty(value = "负责人学生",required = true)
    private String student;

    @ApiModelProperty(value = "负责人学生电话",required = true)
    private String studentPhone;

    @ApiModelProperty("申请组织类型,society:社团，stdGroup:学生组织，depart:部门,volunteerTeam:志愿者队伍")
    private String applyOrgCategory;

    @ApiModelProperty("申请组织id")
    private String applyOrgId;

    @ApiModelProperty("申请组织名")
    private String applyOrgName;

    @ApiModelProperty("活动日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date meetingDate;

    @ApiModelProperty("活动形式")
    private String style;

    @ApiModelProperty("活动主题")
    private String theme;

    @TableField(exist = false)
    private List<MaterialApplyDetail> details;

    @TableField(exist = false)
    private String detailNames;

}
